package com.cl.short_video_java.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

import com.cl.short_video_java.dto.VideoCount;
import lombok.Data;

/**
 * @TableName video_user
 */
@TableName(value = "video_user")
@Data
public class VideoUser implements Serializable {
	/**
	 * 用户表
	 */
	@TableId(type = IdType.AUTO)
	private Integer id;

	/**
	 *
	 */
	private String username;

	/**
	 *
	 */
	private String password;

	/**
	 *
	 */
	private String nickname;

	/**
	 * 用户等级：0-普通用户、1-会员用户
	 */
	private Integer level=0;

	/**
	 * 是否是管理员：0-否，1-是
	 */
	private Integer isAdmin=0;

	/**
	 *
	 */
	private LocalDateTime createTime=LocalDateTime.now();

	/**
	 * 金币
	 */
	private Float balance=0.0F;

	/**
	 * 账号是否可用：0-否，1-是
	 */
	private Integer isDelete=0;

	/**
	 * 邮箱
	 */
	private String email;

	/**
	 * 手机号
	 */
	private String phone;

	/**
	 * 角色id：空就是普通用户
	 */
	private Integer roleId;

	/**
	 * 0-女，1-男,2-未知
	 */
	private Integer sex=2;
	private LocalDateTime birth;
	private String address;
	private Integer isPublish=0;
	/**
	 * 注册类型
	 * 0-账号，1-手机，2-邮箱
	 */
	private Integer registerType;
	@TableField(exist = false)
	private String issuer;
	/**
	 * 分销等级
	 */
	private Integer distributionLevel;
	private Integer pid;
	private String floor;
	private Integer status;
	private String avatar;
	private String backImg;
	private String popularizeCode;
	private LocalDateTime atime;
	private LocalDateTime otime;
	@TableField(exist = false)
	private static final long serialVersionUID = 1L;
	@TableField(exist = false)
	private VideoCount videoCounts;
	/**
	 * 是否关注
	 * 0-为关注，1-已关注
	 */
	@TableField(exist = false)
	private Integer isFollowed = 0;
	/**
	 * 粉丝数量
	 */
	@TableField(exist = false)
	private Long collects;

	@Override
	public boolean equals(Object that) {
		if (this == that) {
			return true;
		}
		if (that == null) {
			return false;
		}
		if (getClass() != that.getClass()) {
			return false;
		}
		VideoUser other = (VideoUser) that;
		return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
				&& (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()))
				&& (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
				&& (this.getNickname() == null ? other.getNickname() == null : this.getNickname().equals(other.getNickname()))
				&& (this.getLevel() == null ? other.getLevel() == null : this.getLevel().equals(other.getLevel()))
				&& (this.getIsAdmin() == null ? other.getIsAdmin() == null : this.getIsAdmin().equals(other.getIsAdmin()))
				&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
				&& (this.getBalance() == null ? other.getBalance() == null : this.getBalance().equals(other.getBalance()))
				&& (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()))
				&& (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
				&& (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
				&& (this.getRoleId() == null ? other.getRoleId() == null : this.getRoleId().equals(other.getRoleId()));
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
		result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
		result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
		result = prime * result + ((getNickname() == null) ? 0 : getNickname().hashCode());
		result = prime * result + ((getLevel() == null) ? 0 : getLevel().hashCode());
		result = prime * result + ((getIsAdmin() == null) ? 0 : getIsAdmin().hashCode());
		result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
		result = prime * result + ((getBalance() == null) ? 0 : getBalance().hashCode());
		result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
		result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
		result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
		result = prime * result + ((getRoleId() == null) ? 0 : getRoleId().hashCode());
		return result;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(getClass().getSimpleName());
		sb.append(" [");
		sb.append("Hash = ").append(hashCode());
		sb.append(", id=").append(id);
		sb.append(", username=").append(username);
		sb.append(", password=").append(password);
		sb.append(", nickname=").append(nickname);
		sb.append(", level=").append(level);
		sb.append(", isAdmin=").append(isAdmin);
		sb.append(", createTime=").append(createTime);
		sb.append(", balance=").append(balance);
		sb.append(", isDelete=").append(isDelete);
		sb.append(", email=").append(email);
		sb.append(", phone=").append(phone);
		sb.append(", roleId=").append(roleId);
		sb.append(", serialVersionUID=").append(serialVersionUID);
		sb.append("]");
		return sb.toString();
	}
}